package com.tsxy.mall.controller.api;

import com.tsxy.mall.service.CollegeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/college")
public class APICollegeController {
    @Autowired
    private CollegeService collegeService;

    @GetMapping("/getAll")
    public List getAll(){
        return collegeService.getAll();
    }


    @GetMapping("/getParent")
    public List getParent(){
        return collegeService.getParent();
    }

    @GetMapping("/getByParent")
    public List getByParent(Integer id){
        return collegeService.getByParent(id);
    }
}
